import request from "@/utils/request";

// 查询配送任务列表
export function listTask(query) {
  return request({
    url: "/system/task/list",
    method: "get",
    params: query,
  });
}

// 查询配送任务详细
export function getTask(taskId) {
  return request({
    url: "/system/task/" + taskId,
    method: "get",
  });
}

// 新增配送任务
export function addTask(data) {
  return request({
    url: "/system/task",
    method: "post",
    data: data,
  });
}

// 修改配送任务
export function updateTask(data) {
  return request({
    url: "/system/task",
    method: "put",
    data: data,
  });
}

// 删除配送任务
export function delTask(taskId) {
  return request({
    url: "/system/task/" + taskId,
    method: "delete",
  });
}
export function express(data) {
  return request({
    url: "/system/task/express",
    method: "post",
    data: data,
  });
}

export function getMyTaskList(data) {
  return request({
    url: "/system/task/getMyTask",
    method: "post",
    data: data,
  });
}

export function successArrive(data) {
  return request({
    url: "/system/task/successArrive?taskId=" + data,
    method: "get",
  });
}
export function failArrive(data, datatwo) {
  return request({
    url: "/system/task/successArrive",
    method: "get",
    params: {
      taskId: data,
      remark: datatwo,
    },
  });
}
